package com.qzw.study.circledepend;

import com.qzw.study.xml.Animal;
import org.springframework.beans.BeansException;
import org.springframework.beans.factory.config.BeanPostProcessor;
import org.springframework.stereotype.Component;

/**
 * @author 屈子威
 * @date 2020/9/16 4:39
 * @description
 */
//@Component
public class SelfBeanPostProcessor implements BeanPostProcessor {
	@Override
	public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException {
		if ("user".equals(beanName)) {
			bean = new Animal();
		}
		return bean;
	}
}
